﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Design;
using System.ComponentModel;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using UIDesigner.DesignContainers;

namespace UIDesigner.Design
{
    public class ObjectTreeViewDesigner : ParentControlDesigner
    {
        private ObjectTreeView m_ctrlObjectTreeView;

        public ObjectTreeViewDesigner()
        {

        }

        public override void DoDefaultAction()
        {
            base.DoDefaultAction();
        }

        public override void Initialize(IComponent component)
        {
            m_ctrlObjectTreeView = (ObjectTreeView) component;

            base.Initialize(component);
        }

        public void ConfigureHandler(object sender, EventArgs e)
        {
            //frmFieldSpecifications frm = new frmFieldSpecifications();
            //ISelectionService objSelectionService = (ISelectionService)((IServiceProvider)context.Container).GetService(typeof(ISelectionService));
            //object[] rgComponents = (object[])objSelectionService.GetSelectedComponents();
            //ObjectControlContainer objContainer = (ObjectControlContainer)rgComponents[0];

            //frm.Specifications = rgSpecs;
            //frm.Construct = objContainer.Construct;

            //if (frm.ShowDialog() == DialogResult.OK)
            //{

            //}
        }

        public override DesignerActionListCollection ActionLists
        {
            get
            {
                return base.ActionLists;
            }
        }

        public override bool CanBeParentedTo(IDesigner parentDesigner)
        {
            return true;
        }

        public override DesignerVerbCollection Verbs
        {
            get 
            {
                DesignerVerbCollection rgVerbs = new DesignerVerbCollection();

                rgVerbs.Add(new DesignerVerb("Configure", new EventHandler(ConfigureHandler)));

                return rgVerbs;
            }
        }
    }
}
